<?
define('BASEPATH', true);
include('config.php');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Admin Panel</title>
<link rel="stylesheet" media="screen" href="css/reset.css" />
<link rel="stylesheet" media="screen" href="css/style.css" />
<link rel="stylesheet" media="screen" href="css/icons.css" />
<link rel="stylesheet" media="screen" href="css/forms.css" />
<link rel="stylesheet" media="screen" href="css/tables.css" />

<!--[if lt IE 8]>
<link rel="stylesheet" media="screen" href="css/ie.css" />
<![endif]-->

<!-- jquerytools -->
<script src="js/jquery.tools.min.js"></script>
<script src="js/jquery.ui.min.js"></script>
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.tables.js"></script>
<script type="text/javascript" src="js/global.js"></script>

<!--[if lt IE 9]>
<script type="text/javascript" src="js/html5.js"></script>
<script type="text/javascript" src="js/PIE.js"></script>
<script type="text/javascript" src="js/IE9.js"></script>
<script type="text/javascript" src="js/ie.js"></script>
<script type="text/javascript" src="js/excanvas.js"></script>
<![endif]-->
</head>
<?if($is_online){?><body>
    <div id="wrapper">
        <header id="page-header">
            <div class="wrapper">
                <div id="util-nav">
                </div>
                <h1>Admin Panel</h1>
                <nav id="main-nav">
                    <ul class="clearfix">
                        <li<?=($_GET['x'] == '' ? ' class="active"' : '')?>><a href="index.php">Dashboard</a></li>
                        <li<?=($_GET['x'] == 'users' ? ' class="active"' : '')?>><a href="index.php?x=users">Users</a></li>
						<li<?=($_GET['x'] == 'sites' ? ' class="active"' : '')?>><a href="index.php?x=sites">Sites</a></li>
						<li<?=($_GET['x'] == 'packs' ? ' class="active"' : '')?>><a href="index.php?x=packs">Coins</a></li>
						<li<?=($_GET['x'] == 'p_packs' ? ' class="active"' : '')?>><a href="index.php?x=p_packs">VIP</a></li>
						<li<?=($_GET['x'] == 'coupons' ? ' class="active"' : '')?>><a href="index.php?x=coupons">Coupons</a></li>
                        <li<?=($_GET['x'] == 'settings' ? ' class="active"' : '')?>><a href="index.php?x=settings">Settings</a></li>
                        <li id="quick-links" class="fr">
                            <li id="upgrade" class="fr"><a href="logout.php">Log Out</a></li>
                        </li>               
                    </ul>
                </nav>
            </div>
<?
	$action = array(
				'users' => 1,
				'settings' => 1,
				'sites' => 1,
				'packs' => 1,
				'p_packs' => 1,
				'addpack' => 1,
				'addpackp' => 1,
				'coupons' => 1,
				'addcoupon' => 1,
				'sales' => 1,
				'search' => 1,
				'dashboard' => 1
			);
	if (isset($_GET['x']) && isset($action[$_GET['x']])) {
		$page_name = $_GET['x'];
	}else{
		$page_name = 'dashboard';
	}
	include($page_name.'.php');
}else{
include("login.php");
}
?>
</html>